import { postRequest } from "../utils/http";
import store from '@/store/index'

export default {
  // 登录请求接口
  async login (params) {
    if (params !== null) {
      let data = await postRequest('/login', params);
      console.log('登录成功后的响应:', data.data.token);
      store.commit('changeLogin', { Authorization: data.data.token })
      console.log(localStorage.getItem('Authorization'));
      return data;
    }
  }
}